<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>

<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<title>充值</title>
<meta name="keywords" content="充值">
<meta name="description"
	content="充值">

<link rel="shortcut icon" href="favicon.ico">
<link href="static/templet/css/bootstrap.min.css?v=3.3.5"
	rel="stylesheet">
<link href="static/templet/css/font-awesome.min93e3.css?v=4.4.0"
	rel="stylesheet">
<link href="static/templet/css/plugins/iCheck/custom.css"
	rel="stylesheet">
<link href="static/templet/css/animate.min.css" rel="stylesheet">
<link href="static/templet/css/style.min862f.css?v=4.1.0"
	rel="stylesheet">

</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">

		<div class="row">
			<div class="col-sm-10">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<div class="form-horizontal">

							<div class="form-group">
								<label class="col-sm-4 control-label">支付方式</label>

								<div class="col-sm-6">
									<select class="form-control" name="payMode" id="payMode"
										data-placeholder="支付方式">
										<c:forEach items="${payList}" var="pay">
					            			<option value="${pay.code }" >${pay.name }</option>
					            		</c:forEach>
									</select>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-4 control-label">充值金额</label>

								<div class="col-sm-6">
									<input type="number" id="price" name="price"
										class="form-control">
								</div>
							</div>
							<div class="hr-line-dashed"></div>

							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-4">
									<button class="btn btn-primary" onclick="save()" type="button">提交</button>
									<button class="btn btn-white" onclick="cancel()" type="button">取消</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<script src="static/templet/js/jquery.min.js?v=2.1.4"></script>
	<script src="static/templet/js/bootstrap.min.js?v=3.3.5"></script>
	<script src="static/templet/js/content.min.js?v=1.0.0"></script>
	<script src="static/templet/js/iframe.min.js"></script>
	<script src="static/templet/js/plugins/layer/layer.min.js"></script>
	<script src="static/templet/js/plugins/iCheck/icheck.min.js"></script>
	<script type="text/javascript">

		function cancel() {
			iframe.close(0);
		}

		function save() {

			
			
			var payMode = $.trim($("#payMode").val());
			if (payMode == '') {
				layer.msg('请选择支付方式', {
					icon : 1
				});
				return;
			}

			if(payMode == 'offline'){
				layer.open({
		    	    type: 2,
		    	    title: '线下充值-二维码',
		    	    shadeClose: false,
		    	    shade: 0.8,
		    	    area: ['60%', '100%'],
		    	    content: 'recharge/offlineQrCode'
		    	});
			}else {

				var price = $.trim($("#price").val());
				if (price == '') {
					layer.msg('请输入金额', {
						icon : 1
					});
					return;
				}
				layer.confirm('是否确认支付', {
				    btn: ['确认','取消'],
				    shade: true
				}, function(index){
					layer.close(index);
					layer.open({
			    	    type: 2,
			    	    title: '充值-二维码',
			    	    shadeClose: false,
			    	    shade: 0.8,
			    	    area: ['600px', '600px'],
			    	    content: 'recharge/qrCode'
			    	});
				}, function(){
				    
				});
			}
			
			

			
		}
	</script>
</body>

</html>